﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>oceanho.webapi.factory演示-表单提交-[Xml]</title>
    <script type="text/javascript">
        function encodeParam() {
            var values = document.getElementById("_xml_user_s").innerHTML;
            for (var i = 0; i < values.length; i++) {
            if (values[i] == "<") { values[i] = "lt;";}
                else if (values[i] == ">") { values[i] = "gt;"; }
            }
            document.getElementById("_xml_user").value = values;
            alert(document.getElementById("_xml_user").value);         
            return true;
        }
    </script>
</head>
<body>
    <form action="/api/tests/submit-xml" enctype="application/x-www-form-urlencoded" method="post" target="_blank" onsubmit="javascript:return encodeParam();">
        <textarea id="_xml_user_s">
            <?xml version="1.0" encoding="UTF-8" ?>
            <user>
                <id>88888</id>
                <age>35</age>
                <name>ocean</name>
            </user>
        </textarea>
        <input type="submit" value="提交xml文档" />
        <input type="hidden" name="_xml_user" id="_xml_user" />
    </form>
</body>
</html>
